<!doctype html>
<html lang="en" class="fixed">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>课程表</title>
    <link rel="apple-touch-icon" sizes="120x120" href="favicon/apple-icon-120x120.png">
    <link rel="icon" type="image/png" sizes="192x192" href="favicon/android-icon-192x192.png">
    <link rel="icon" type="image/png" sizes="32x32" href="favicon/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="favicon/favicon-16x16.png">
    <link rel="stylesheet" type="text/css"
          href="<?php xcho(loadSource('/assets/plugins/bootstrap/css/bootstrap.min.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/animate.css/animate.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/font-awesome/css/font-awesome.css')) ?>">
    <link rel="stylesheet"
          href="<?php xcho(loadSource('/assets/plugins/data-table/media/css/dataTables.bootstrap.min.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/ztree/css/zTreeStyle/zTreeStyle.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/app/css/style.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/layui/css/layui.css')) ?>" media="all">
        <!--    <link rel="stylesheet" href="-->
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/fullcalendar/fullcalendar.min.css')) ?>">
   <!-- <link rel="stylesheet" href="<?php /*xcho(loadSource('/assets/plugins/fullcalendar/fullcalendar.print.min.css')) */?>">-->
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/layui/css/layui.css')) ?>" media="all">

    <link rel="stylesheet" href="<?php xcho(loadSource('/app/css/app.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/css/new_main.css')) ?>">
    
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        ul,li,ol,li{
            list-style: none;
        }
        .content-cont{
            width: 1200px;
            background: #fff;
            margin: 0 auto;
        }
        .content-cont .cont-title{
            padding: 10px 0 5px;
            border-bottom: 1px #ccc solid;
        }
        .content-cont .cont-title h2{
            font-size: 16px;
            padding-left: 20px;
            display: inline-block;
        }
        .content-cont .cont-title h2 button{
            padding: 6px 14px;
            background: rgba(226,175,8,.6);
            border: none;
            box-shadow: 0 0 5px #ccc;
            border-radius: 5px;
            font-size: 10px;
            color: #fff;
            margin-left: 80px;
        }
        .content-cont .cont-title ol{
            padding: 10px 20px;
            display: inline-block;
        }
        .content-cont .cont-title ol li{
            display: inline-block;
            margin: 0 5px;
        }
        .content-cont .cont-title ol li button{
            padding: 4px 10px;
            border: none;
            border-radius: 5px;
            color:#fff;
            font-size: 12px;
            background: #1ab394;
        }
        .content-cont .cont-title ul{
            float: right;
            padding: 10px 20px;
        }
        .content-cont .cont-title ul li{
            display: inline-block;
            margin: 0 5px;
        }
        .content-cont .cont-title ul li button{
            padding: 4px 10px;
            border: none;
            border-radius: 5px;
            color:#fff;
            font-size: 12px;
            background: #1ab394;
        }
        .content-cont .cont-title ul li:nth-of-type(3) button{
            background: rgba(215,82,52,.6);
        }
        .content-cont .cont{
            padding: 20px;
        }
        .content-cont .cont ul.list{
            display: inline-block;
            border: 1px #eee solid;
            float: left;
        }
        .content-cont .cont ul.list li{
            line-height: 30px;
            font-size: 12px;
            padding: 0 16px;
            border-bottom: 1px #eee solid;
            cursor: pointer;
        }
        .content-cont .cont ul.list li.active{
            background: #E7F4FD;
            color:#3F93EC;
        }
        .content-cont .cont ul.list li:nth-of-type(3){
            border-bottom: none;
        }
        .content-cont .cont .cont-tab{
            display: inline-block;
            margin-left: 20px;
            width: 80%;
        }
        .content-cont .cont .cont-tab>div{
            display: none;
            width: 100%;
        }
        /*---------------schedule------------------*/
        .content-cont .cont .cont-tab>div.schedule button{
            padding: 4px 14px;
            border: none;
            border-radius: 5px;
            background: #1ab394;
            color:#fff;
            font-size: 12px;
            margin-left: 10px;
        }
        .content-cont .cont .cont-tab>div.schedule h4{
            display: inline-block;
            margin-left: 200px;
        }
        .content-cont .cont .cont-tab>div.schedule table{
            width: 100%;
        }
        .content-cont .cont .cont-tab>div.schedule table thead tr{
            border-bottom: 3px #eee solid;

        }
        .content-cont .cont .cont-tab>div.schedule table thead tr th{
            text-align: center;
            padding: 10px 0;
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr{
            border-bottom: 3px #eee solid;
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr span{
            color:#333;
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr span b{
            padding: 4px 8px;
            font-weight: normal;
            font-size: 12px;
            color: #fff;
            background: #1ab394;
            border-radius: 5px;
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr ul{
            margin-top: 6px;
            padding: 4px 10px;
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr td:nth-of-type(even) ul:nth-of-type(odd){
            background: rgba(238,238,238,.5);
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr td:nth-of-type(odd) ul:nth-of-type(even){
            background: rgba(238,238,238,.5);
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr td{
            vertical-align: initial;
            padding: 10px 0;
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr td ul li{
            line-height: 24px;
            font-size: 12px;
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr td ul li:nth-of-type(3){
            color:#108EE9;
        }
        /*------------------charge-record----------------*/
        .content-cont .cont .cont-tab .charge-record table tbody tr td:last-child span{
            margin: 0 5px;
            color:#777;
            position: relative;
            cursor: pointer;
        }
        .content-cont .cont .cont-tab .charge-record table tbody tr td:last-child span b{
            width: 40px;
            line-height: 24px;
            background: #fff;
            position: absolute;
            bottom: -25px;
            left: -15px;
            font-weight: normal;
            font-size: 10px;
            color:#000;
            border: 1px #ccc solid;
            border-radius: 5px;
            display: none;
        }
        body {
            margin: 40px 10px;
            padding: 0;
            font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
            font-size: 14px;
            background: #fff;
        }
        #calendar {
            width: 900px;
            max-width: 900px;
            margin: 0 auto;
        }
        .fc button, .fc-button-group, .fc-time-grid .fc-event .fc-time span{
            display: inherit;
        }
        .keB .student-title{
            text-align: center;
            margin-bottom: 15px;
        }
        .keB .student-title h2{
            font-size:18px;
        }
    </style>
</head>

<body><?php include_once TPL_PATH . 'public/nav.phtml'; ?>
<!--初试日期-->
<input type="hidden" id="date_time" name="date_time" value="<?php xcho($aData['sDates'])?>">
<!--教师或学生id-->
<input type="hidden" id="user_id" name="user_id" value="<?php xcho($aData['iUserId'])?>">
<!--教师学生分类-->
<input type="hidden" id="user_type" name="user_type" value="<?php xcho($aData['sUserType'])?>">
<!--ajax地址-->
<input type="hidden" id="search_url" name="search_url" value="<?php xcho($sSearchAction)?>">
<div class="keB">
    <div class="student-title">
        <h2>水电费</h2>
    </div>
    <div id='calendar'></div>
</div>
<!--<div class="wrap">
    <div class="page-body" style="padding: 0">
        <div class="content" style="margin: 0;background: #F4F4F4">
            <div class="content-cont">
                <div class="cont">
                    <div class="cont-tab">
                        <div class="schedule">
                            <div class="schedule-title">
                                <input type="date">
                                <button>今天</button>
                                <h4>朱浩的课表</h4>
                                <table>
                                    <thead>
                                    <tr>
                                        <th>周一<br>MON</th>
                                        <th>周二<br>TUE</th>
                                        <th>周三<br>WED</th>
                                        <th>周四<br>THU</th>
                                        <th>周五<br>FRI</th>
                                        <th>周六<br>SAT</th>
                                        <th>周日<br>SUN</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td>
                                            <span>6-28(5节课)</span>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                        </td>
                                        <td>
                                            <span>6-29(2节课)</span>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                        </td>
                                        <td>
                                            <span>6-30(3节课)</span>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                        </td>
                                        <td>
                                            <span>7-01(1节课)</span>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                        </td>
                                        <td>
                                            <span>7-02(2节课)</span>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                        </td>
                                        <td>
                                            <span>7-03(5节课)</span>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                        </td>
                                        <td>
                                            <span>7-04(1节课)</span>
                                            <ul>
                                                <li>张景辉</li>
                                                <li>10:00-11:30(补课)</li>
                                                <li>正式-同步-17夏-常规-语</li>
                                            </ul>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span>7-05(1节课)</span>
                                        </td>
                                        <td>
                                            <span>7-06(1节课)</span>
                                        </td>
                                        <td>
                                            <span>7-07(1节课)</span>
                                        </td>
                                        <td>
                                            <span>7-08(1节课)</span>
                                        </td>
                                        <td>
                                            <span>7-09(1节课) <b>今天</b> </span>
                                        </td>
                                        <td>
                                            <span>7-10(1节课)</span>
                                        </td>
                                        <td>
                                            <span>7-11(1节课)</span>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>-->
<script src="<?php xcho(loadSource('/assets/plugins/jquery/jquery.min.js')) ?>"></script>
<script src="<?php xcho(loadSource('/assets/plugins/fullcalendar/lib/moment.min.js')) ?>"></script>
<script src="<?php xcho(loadSource('/assets/plugins/fullcalendar/fullcalendar.min.js')) ?>"></script>
<script src="<?php xcho(loadSource('/assets/plugins/layui/layui.all.js')) ?>" charset="utf-8"></script>
<script src="<?php xcho(loadSource('/assets/plugins/bootstrap/js/bootstrap.min.js')) ?>"></script>
<script>
/*    $(function () {
        $(".cont>ul.list>li").click(function(){
            var ind=$(this).index();
            $(this).addClass("active").siblings("li").removeClass("active");
            $(".cont>.cont-tab>div").eq(ind).slideDown(200).siblings("div").slideUp(200);
        })
        $("table tr>td>span").hover(function(){
            $(this).find("b").show();
        },function(){
            $(this).find("b").hide();
        })
        $(".he-course>ul>li").click(function(){
            var ind=$(this).index();
            $(this).addClass("active").siblings("li").removeClass("active");
            $(".heCourse-cont>div").eq(ind).slideDown(200).siblings("div").slideUp(200);
        })

    });*/
//console.log($("input[name='date_time']").val());
    $(document).ready(function() {
        $('#calendar').fullCalendar({
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,basicWeek,basicDay'
            },
            defaultDate: "<?php xcho($aData['sDates'])?>",
            navLinks: true, // can click day/week names to navigate views
            editable: true,
            eventLimit: true, // allow "more" link when too many events
            defaultView: 'basicWeek',
            events: function(start, end, timezone, callback) {
                var ajUrl = $("input[name='search_url']").val();
                //console.log(date);
                $.ajax({
                    url: ajUrl,
                    dataType: 'json',
                    cache:false,
                    data: {
                        // our hypothetical feed requires UNIX timestamps
                        start_time: start.unix(),
                        end_time: end.unix(),
                        user_id: $("input[name='user_id']").val(),
                        user_type:$("input[name='user_type']").val()
                    },
                    success: function(doc) {
                        //console.log(doc);
                        //console.log(doc.sTitleName);
                        $(".student-title>h2").html(doc.sTitleName);
                        var events = [];
                        $.each(doc.aCourseLessons,function(i,val){
                           // console.log(val.data_type);
                            if(val.data_type=="course"){
                                events.push({
                                    id:val.id,
                                    title: val.user_name+'\r\n'+val.times+'('+val.arrange_status+')'+'\r\n'+val.cname,
                                    allDay:true,
                                    start: val.start_time,// will be parsed
                                    end:val.end_time,
                                    url:val.course_url,
                                });
                            }else if(val.data_type == "schedule"){
                                events.push({
                                    title: val.topic+'\r\n'+val.times,
                                    allDay:true,
                                    start: val.start_time,// will be parsed
                                    end:val.end_time,
                                    url:val.syllabus_url,
                                });
                            }
                        });
                        callback(events);
                        //新打开页面
                        $(".fc-event-container>a.fc-day-grid-event").attr("target","_blank");
                       $(".fc-more").click(function(){
                           $(".fc-body.fc-widget-content>.fc-event-container>a.fc-day-grid-event").attr("target","_blank");
                       })

                    }
                });
            },
        });
    });
</script>
<?php include_once TPL_PATH . 'public/foot_script.phtml'; ?>
<button id="top" style="height: 50px;width: 50px;"></button></body>

</html>
